package com.example.myapplication;

import android.annotation.SuppressLint;
import android.content.Context;

/**
 * 单列
 * Created by Lx on 2018/11/19.
 */

public class AppSettings {

    @SuppressLint("StaticFieldLeak")
    private static Context context;

    private AppSettings() {}

    private static class AppSettingsHelper {
        @SuppressLint("StaticFieldLeak")
        private static AppSettings appSettings = new AppSettings();
    }

    public static AppSettings getInstance(Context context) {
        AppSettings.context = context.getApplicationContext();
        return AppSettingsHelper.appSettings;
    }

}
